{{!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
}}

{{#if loaded}}
  <table class='detail-list'>
    <thead>
      <tr>
        <th colspan=2>Details</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Task Attempt ID</td>
        <td>{{model.entityID}}</td>
      </tr>
      <tr>
        <td>Task ID</td>
        <td>{{model.taskID}}</td>
      </tr>
      <tr>
        <td>Container ID</td>
        <td>{{txt model.containerID}}</td>
      </tr>
      <tr>
        <td>Node ID</td>
        <td>{{txt model.nodeID}}</td>
      </tr>
      <tr>
        <td>Status</td>
        <td>{{em-table-status-cell content=model.status}}</td>
      </tr>
      <tr>
        <td>Progress</td>
        <td>{{em-table-progress-cell content=model.progress}}</td>
      </tr>
      <tr>
        <td>Start Time</td>
        <td>{{date-formatter content=model.startTime}}</td>
      </tr>
      <tr>
        <td>End Time</td>
        <td>{{date-formatter content=model.endTime}}</td>
      </tr>
      <tr>
        <td>Duration</td>
        <td>{{txt model.duration type="duration"}}</td>
      </tr>
      <tr>
        <td>Log</td>
        <td>
          {{#if model.logURL}}
            <a href={{model.logURL}} target="_blank">
              <i class="fa fa-file-o" aria-hidden="true"></i> View
            </a>
            &nbsp;
            <a href={{model.logURL}} target="_blank" download>
              <i class="fa fa-download" aria-hidden="true"></i> Download
            </a>
          {{else}}
              <span class="txt-message">Not Available!</span>
          {{/if}}
        </td>
      </tr>
      <tr>
        <td>Container Logs</td>
        <td>
          {{#if model.containerLogURL}}
            <a href={{model.containerLogURL}} target="_blank">
              <i class="fa fa-file-o" aria-hidden="true"></i> View
            </a>
            &nbsp;
            <a href={{model.containerLogURL}} target="_blank" download>
              <i class="fa fa-download" aria-hidden="true"></i> Download
            </a>
          {{else}}
              <span class="txt-message">Not Available!</span>
          {{/if}}
        </td>
      </tr>
    </tbody>
  </table>

  {{#if model.diagnostics}}
    <div class="panel panel-danger">
      <div class="panel-heading">
        Diagnostics
      </div>
      <div class="diagnostics">
        {{{model.diagnostics}}}
      </div>
    </div>
  {{/if}}

{{else}}
  {{partial "loading"}}
{{/if}}
